//
//  Home_MiddleTableViewCell.m
//  sellHouse
//
//  Created by 李 佳伟 on 2018/12/10.
//  Copyright © 2018年 李 佳伟. All rights reserved.
//

#import "Home_MiddleTableViewCell.h"
#import "JTCSM.h"
@implementation Home_MiddleTableViewCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}
- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    
    if (self == [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        
        
        
        
        UILabel *titleLabel = [UILabel initWithFrame:CGRectMake(Kspace, 0, KSCREENWidth-2*Kspace, 48) text:@"卖房流程" font:17 textAlignment:NSTextAlignmentLeft texcolor:RGBACOLOR(51, 51, 51, 1) backgroundColor:nil];
        [self.contentView addSubview:titleLabel];
        [df lineViewWithHeightofTop:KVIEW_Y(titleLabel) superView:self.contentView lineHeight:1 space:Kspace];
        
        
        CGFloat changewidth = 50;
        CGFloat numberspace = (KSCREENWidth-changewidth*3)/4;
        
        for (int i = 0; i<3; i++) {
            UILabel *label = [UILabel initWithFrame:CGRectMake(numberspace+(changewidth+numberspace)*i, KVIEW_Y(titleLabel)+20, changewidth, changewidth) text:[NSString stringWithFormat:@"%d",i+1] font:22 textAlignment:NSTextAlignmentCenter texcolor:RGBACOLOR(51, 51, 51, 1) backgroundColor:RGBACOLOR(241, 241, 241, 1)];
            label.tag= 1000+i;
            [df layerWithView:label radius:changewidth/2 width:0.5 color:RGBACOLOR(231, 231, 231, 1)];
            [self.contentView addSubview:label];
        }
        
        CGFloat zheimagesize = 30;
        
        UIImageView *oneImagev = [[UIImageView alloc]initWithFrame:CGRectMake(numberspace+changewidth+(numberspace-zheimagesize)/2, KVIEW_Y(titleLabel)+20+(changewidth-zheimagesize)/2, zheimagesize, zheimagesize)];
        oneImagev.image = [UIImage imageNamed:@"JIANTOU.png"];
        [self.contentView addSubview:oneImagev];
        
        UIImageView *twoimagev = [[UIImageView alloc]initWithFrame:CGRectMake(numberspace*2+(numberspace-zheimagesize)/2+changewidth*2, KVIEW_Y(titleLabel)+20+(changewidth-zheimagesize)/2, zheimagesize, zheimagesize)];
        twoimagev.image = [UIImage imageNamed:@"JIANTOU.png"];
        [self.contentView addSubview:twoimagev];
        
        CGRect zherect = [df labelHeightWithContent:@"平均13天成交" width:1000 font:12];
        
        CGFloat labelspace = (KSCREENWidth-zherect.size.width*3)/4;
        
        NSArray *arr = @[@"在线提交委托",@"全城中介售卖",@"买家购房签约"];
        NSArray *arr1 = @[@"免费上门评估",@"买家咨询看房",@"平均13天成交"];
        UILabel *zhel = [self.contentView viewWithTag:1000];
        for (int i = 0; i<arr.count; i++) {
            UILabel *label = [UILabel initWithFrame:CGRectMake(labelspace+(zherect.size.width+labelspace)*i, KVIEW_Y(zhel)+12, zherect.size.width, zherect.size.height) text:arr[i] font:12 textAlignment:NSTextAlignmentCenter texcolor:RGBACOLOR(153, 153, 153, 1) backgroundColor:nil];
            [self.contentView addSubview:label];
            
            UILabel *label1 = [UILabel initWithFrame:CGRectMake(labelspace+(zherect.size.width+labelspace)*i, KVIEW_Y(label)+8, zherect.size.width, zherect.size.height) text:arr1[i] font:12 textAlignment:NSTextAlignmentCenter texcolor:RGBACOLOR(153, 153, 153, 1) backgroundColor:nil];
            [self.contentView addSubview:label1];
            label1.tag = 2000+i;
        }
        
        UILabel *label1 = [self.contentView viewWithTag:2000];
        UIView *twolineviw = [df lineViewWithHeightofTop:KVIEW_Y(label1)+23 superView:self.contentView lineHeight:10 space:0];
        UILabel *secondtitleLabel = [UILabel initWithFrame:CGRectMake(Kspace, KVIEW_Y(twolineviw), KSCREENWidth-2*Kspace, 48) text:@"卖房优势" font:17 textAlignment:NSTextAlignmentLeft texcolor:RGBACOLOR(51, 51, 51, 1) backgroundColor:nil];
        [self.contentView addSubview:secondtitleLabel];
        [df lineViewWithHeightofTop:KVIEW_Y(secondtitleLabel) superView:self.contentView lineHeight:1 space:Kspace];
        
        CGFloat twochangespace = 8;
        CGFloat youshiviewwidth = (KSCREENWidth-2*Kspace-twochangespace)/2;
        CGFloat youshiviewHeihgt = youshiviewwidth/82*31;
        CGFloat labeltitleHeight = 14;
        CGFloat labelcontentHeight = 12;
        CGFloat labelchangspace = 7;
        CGFloat labeltop = (youshiviewHeihgt-labeltitleHeight-labelcontentHeight-labelchangspace)/2;
        CGFloat labelspaceleft = 10;
        NSArray *titArray = @[@"最快售出",@"全城中介",@"全城经纪人",@"储备买家"];
        NSArray *conArray = @[@"2小时",@"1100家",@"1万+",@"6万+"];
        for (int i = 0 ; i<4; i++) {
            UIImageView *view = [[UIImageView alloc]initWithFrame:CGRectMake(Kspace +(youshiviewwidth+twochangespace)*(i%2), KVIEW_Y(secondtitleLabel)+22+(youshiviewHeihgt+twochangespace)*(i/2), youshiviewwidth, youshiviewHeihgt)];
            [df layerWithView:view radius:0 width:1 color:RGBACOLOR(241, 241, 241, 1)];
            [self.contentView addSubview:view];
            view.image = [UIImage imageNamed:[NSString stringWithFormat:@"youshi%d.jpeg",i]];
            view.tag = 4000+i;
            
            
            UILabel *titlel = [UILabel initWithFrame:CGRectMake(labelspaceleft, labeltop, youshiviewwidth-labelspaceleft, labeltitleHeight) text:titArray[i] font:14 textAlignment:NSTextAlignmentLeft texcolor:RGBACOLOR(102, 102, 102, 1) backgroundColor:nil];
            [view addSubview:titlel];
            UILabel *contentl = [UILabel initWithFrame:CGRectMake(labelspaceleft, KVIEW_Y(titlel)+labelchangspace, youshiviewwidth-labelspaceleft, labelcontentHeight) text:conArray[i] font:12 textAlignment:NSTextAlignmentLeft texcolor:RGBACOLOR(102, 102, 102, 1) backgroundColor:nil];
            [view addSubview:contentl];
            [contentl setFont:[UIFont fontWithName:@"Helvetica-Bold" size:12]];
            
        }
        UIView *tagview = [self.contentView viewWithTag:4003];
        UIView *threeLine= [df lineViewWithHeightofTop:KVIEW_Y(tagview)+23 superView:self.contentView lineHeight:10 space:0];
        
        UILabel *thirdtitleLabel = [UILabel initWithFrame:CGRectMake(Kspace, KVIEW_Y(threeLine), KSCREENWidth-2*Kspace, 48) text:@"秒卖房问答" font:17 textAlignment:NSTextAlignmentLeft texcolor:RGBACOLOR(51, 51, 51, 1) backgroundColor:nil];
        [self.contentView addSubview:thirdtitleLabel];
        [df lineViewWithHeightofTop:KVIEW_Y(thirdtitleLabel) superView:self.contentView lineHeight:1 space:Kspace];
        
        [df lineViewWithHeightofTop:KVIEW_Y(thirdtitleLabel)+10 superView:self.contentView lineHeight:10 space:0].backgroundColor=[UIColor whiteColor];
        
        
        
    }
    
    return self;
}


@end
